{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "c07111ce",
   "metadata": {},
   "source": [
    "# 知识库\n",
    "\n",
    "解压数据\n",
    "\n",
    "```bash\n",
    "tar jxvf enwiki-20171001-pages-meta-current-withlinks-abstracts.tar.bz2\n",
    "\n",
    "```\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "2251bcd7",
   "metadata": {},
   "outputs": [],
   "source": [
    "import json\n",
    "from common_utils import read_jsonl, read_json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "366ddc30",
   "metadata": {},
   "outputs": [],
   "source": [
    "datas = read_jsonl(\"./HotpotQA/enwiki-20171001-pages-meta-current-withlinks-abstracts/AA/wiki_00\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "bd986dca",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['id', 'url', 'title', 'text', 'charoffset', 'text_with_links', 'charoffset_with_links'])"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "item=datas[0]\n",
    "item.keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2c4a9494",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fbc66255",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "60eeda87",
   "metadata": {},
   "source": [
    "# 数据集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "7d6c3975",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "7405"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datas = read_json(\"./HotpotQA/hotpot_dev_distractor_v1.json\")\n",
    "len(datas)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "162fd2b3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['_id', 'answer', 'question', 'supporting_facts', 'context', 'type', 'level'])"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "item=datas[0]\n",
    "item.keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c0d76398",
   "metadata": {},
   "outputs": [],
   "source": [
    "item"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c3d4b52f",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "29cfba98",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {
    "height": "calc(100% - 180px)",
    "left": "10px",
    "top": "150px",
    "width": "342.969px"
   },
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
